package edu.mis.model;

import java.util.List;

import edu.mis.model.base.BaseCategory;


@SuppressWarnings("serial")
public class Category extends BaseCategory<Category> {
	public static final Category dao = new Category().dao();
	
	public List<Category> findAll(){
		return dao.find("SELECT * FROM category");
	}
	public Category findCategoryByName(String name){
		return findFirst("SELECT * FROM category WHERE categoryName = ? ",name);
	}
	
	
	public List<Goods> getGoods(){
		return Goods.dao.find("SELECT *  FROM goods WHERE categoryId=?",get("id"));
	}
}
